package Boundry;

import java.awt.Color;
import java.awt.SystemColor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;

import Boundry.GenericTools.IPanelOperation;
import Boundry.GenericTools.RequestInfoAndInputPanel;
import Controllers.GlobalData;
import Controllers.GenericToolsForController.PDFDocument;
import Controllers.GenericToolsForController.PDFfile;
import Entity.EvaluationReport;

import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Font;
import java.io.IOException;

import javax.swing.JScrollPane;
import javax.swing.JTextField;

public class ReevaluationPanel extends RequestInfoAndInputPanel implements IPanelOperation{
	private JButton btnShowFile;
	private JTextField txtFieldNotes;
	private JPanel pnlEnterNotes;

	
	public ReevaluationPanel()
	{
		super();
		 ReevaluationPanelInit();
	
	}
	
	
public void ReevaluationPanelInit()
{
	btnShowFile = new JButton("");
	pnlEnterNotes = new JPanel();
	JLabel lblEnterAllRelavant = new JLabel("Enter All Relavant details :");
	JScrollPane scrollPane = new JScrollPane();
	txtFieldNotes = new JTextField();

	btnShowFile.setBounds(47, 58, 89, 41);
	btnShowFile.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent e)
		{
			if (GlobalData.request != null && GlobalData.request.getEvaluationReport() !=null)
			{
				String path = null;
				EvaluationReport evalRep = (EvaluationReport)GlobalData.request.getEvaluationReport();	
				new PDFDocument(path);
			}
			
		}
});
	
	pnlEnterNotes.setBounds(37, 221, 807, 147);
	mainPanel.add(pnlEnterNotes);
	pnlEnterNotes.setLayout(null);
	
	lblEnterAllRelavant.setFont(new Font("Tahoma", Font.PLAIN, 14));
	lblEnterAllRelavant.setBounds(23, 24, 202, 23);
	pnlEnterNotes.add(lblEnterAllRelavant);
	
	scrollPane.setBounds(287, 24, 510, 112);
	pnlEnterNotes.add(scrollPane);
	
	pnlEnterNotes.add(btnShowFile);
	scrollPane.setViewportView(txtFieldNotes);
	txtFieldNotes.setColumns(10);
	btnShowFile.setBackground(SystemColor.inactiveCaption);
	btnShowFile.setForeground(Color.RED);
	btnShowFile.setIcon(new ImageIcon(FindRequestGUI.class.getResource("/ICONS/4_collections_collection.png")));	
	btnShowFile.setVisible(false);
	if (GlobalData.request != null && GlobalData.request.getEvaluationReport() !=null) 
	{
		btnShowFile.setVisible(true);

	}
}
@Override
public String apHelpButton() {
  	return " Here the Evaluator can enetr more details if he was required to do so";
}
@Override
public String setTitle() {
	
	 return "Re-Evaluation";
}


public JButton getBtnShowFile() {
	return btnShowFile;
}


public void setBtnShowFile(JButton btnShowFile) {
	this.btnShowFile = btnShowFile;
}


public JTextField getTxtFieldNotes() {
	return txtFieldNotes;
}


public void setTxtFieldNotes(JTextField txtFieldNotes) {
	this.txtFieldNotes = txtFieldNotes;
}


public JPanel getPnlEnterNotes() {
	return pnlEnterNotes;
}


public void setPnlEnterNotes(JPanel pnlEnterNotes) {
	this.pnlEnterNotes = pnlEnterNotes;
}

}